<div>
    <style>
        .modal-dialog {
            width: 430px;
        }
        .select_box_this {
            margin: 10px 0 20px;
            width: 100%;
            text-align: right;
            font-size: 16px;
        }
        .select_box_this .form-group{
            margin-top: 5px;;
        }
    </style>
    <form id="migration" action="__SELF__" method="post" class="ajax-form">
        <div class="select_box_this">
            <notempty name="type_list">
                <div class="form-group">
                    <label class="col-xs-4 control-label" style="text-align: right;">
                       {:L("_INVITATION_CODE_TYPE_")}{:L("_COLON_")}
                    </label>
                    <div class="col-xs-8">
                        <select class="form-control"  name="invite">
                            <volist name="type_list" id="invite">
                                <option value="{$invite.id}">{$invite.title}</option>
                            </volist>
                        </select>
                        <div class="clearfix"></div>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="form-group">
                    <label class="col-xs-4 control-label" style="text-align: right;">
                       {:L("_GENERATE_A_NUMBER_")}{:L("_COLON_")}
                    </label>

                    <div class="col-xs-8">
                        <input type="text" name="code_num" class="form-control" value="1">
                        <div class="clearfix"></div>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="form-group">
                    <label class="col-xs-4 control-label" style="text-align: right;">
                       {:L("_REGISTERED_NUMBER_")}{:L("_COLON_")}
                    </label>

                    <div class="col-xs-8">
                        <input type="text" name="can_num" class="form-control" value="1">
                        <div class="clearfix"></div>
                    </div>
                    <div class="col-xs-8" style="color: #b3b3b3;margin-left: 41px;font-size: 14px;">{:L("_EACH_INVITATION_CODE_IS_ALLOWED_TO_REGISTER_A_NUMBER_")}</div>

                </div>
                <div class="clearfix"></div>
                <else/>
               {:L("_THERE_IS_NO_OPTIONAL_TYPE_OF_INVITATION_CODE_PLEASE_CREATE_AND_ENABLE_THE_TYPE_OF_INVITATION_CODE_")}
            </notempty>

        </div>
        <div style="width: 100%;text-align: center;">
            <a class="btn btn-primary" data-role="submit">{:L("_GENERATION_")}</a>
            <a onclick="$('.close').click();" class="btn btn-default">{:L("_CANCEL_")}</a>
        </div>
    </form>
</div>
<script>
    $(function(){
        $('[data-role="submit"]').click(function(){
            query=$('#migration').serialize();
            var url=$('#migration').attr('action');
            $.post(url,query,function(msg){
                if(msg.status){
                    toast.success({:L('_BUILD_SUCCESS_WITH_SINGLE_')});
                    setTimeout(function(){
                        window.location.href=msg.url;
                    },1500);
                }else{
                    handleAjax(msg);
                }
            },'json');
        });
    });
</script>